package com.loong.news.controller.forehead;

import com.loong.common.domain.BaseQuery;
import com.loong.common.mvc.BaseBackendController;
import com.loong.common.rest.Result;
import com.loong.common.validator.group.CommonInsert;
import com.loong.common.validator.group.CommonUpdate;
import com.loong.common.validator.group.CommonValidate;
import com.loong.news.common.backend.param.NewsCategoryParam;
import com.loong.news.handler.NewsCategoryHandler;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @Description: 处理新闻类目请求的controller
 * @Author: 刘群
 * @Date: 2020/10/14 15:22
 */
@RestController
@RequestMapping("forehead/news/newsCategory")
public class NewsCategoryForeheadController extends BaseBackendController {

    @Resource
    private NewsCategoryHandler categoryHandler;

    /**
     * 分页查询新闻类别
     * @param queryParam
     * @return
     */
    @PostMapping("pageQuery")
    public Result pageQuery(@RequestBody BaseQuery queryParam){
        return handlerExecutor.execute(() -> categoryHandler.pageQuery(queryParam));
    }
}
